package demo_Book; // 包名为Book

// Book类，表示书籍信息
public class Book {
    private String BookCode; // 书籍的id号
    private String title; // 书籍的标题
    private String author; // 书籍的作者
    private String price; // 书籍的价格

    public Book(String bookCode, String title, String author, String price) {
        this.BookCode = bookCode;
        this.title = title;
        this.author = author;
        this.price = price;
    }

    public String getBookCode() { return BookCode; }

    public void setBookCode(String id) { this.BookCode = id; }

    public String getTitle() { return title; }

    public void setTitle(String title) { this.title = title; }

    public String getAuthor() { return author; }

    public void setAuthor(String author) { this.author = author; }

    public String getPrice() { return price; }

    public void setPrice(String price) { this.price = price; }

// 不遵循单一职责原则的代码实现
//    public void updateBook(String bookCode, String title, String author, String price) {
//          this.title=title;
//          this.author=author;
//          this.price=price;
//          System.out.println("书籍已更新。");
//
//    }
//    不遵循单一职责原则的代码实现
//    public void addBook(Book book) {
//        books[count++] = book;
//        System.out.println("书籍添加成功。");
//    }

}
